home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / gus / patinf11.zip / PATINFO.DOC < prev    next >
Text File  |  1993-03-26  |  10KB  |  245 lines

  1.  
  2.  
  3. Introduction
  4. ------------
  5. PatInfo is a program that I wrote mostly for my own enjoyment as I was
  6. exploring the structure of the Gravis Ultrasound's patch files.  It
  7. shows the values of some of the data that is stored in the patch file.
  8. Using PatInfo, you can quickly get information about patches like the 
  9. examples below:
  10.  
  11. File: MIDI\TRUMPET.PAT 
  12. This file contains  2  sample(s).
  13.  
  14. Sample # 1 
  15. Sample length: 6908         Loop start:  6660           Loop end: 6890 
  16. Sample rate: 44642 Hz
  17. Low freq: 27.499 (A0)    High freq: 466.163 (A#4)    Base freq: 390.464 (?G4)
  18. Detune: 0     Octave: 2     Balance: 7    Mode: 0 0 0 0 1 1 0 1
  19. Envelope/tremolo/vibrato data:
  20.   56 178 168  69  63  63 246 246 246   8   8   8   0   0   0  80 200   8
  21. Flags: 16-bit looped forward melodic 
  22.  
  23.  
  24. Sample # 2 
  25. Sample length: 6282         Loop start:  6166           Loop end: 6252 
  26. Sample rate: 22321 Hz
  27. Low freq: 466.163 (A#4)    High freq: 4186.073 (C8)    Base freq: 523.251 (C5)
  28. Detune: 0     Octave: 2     Balance: 7    Mode: 0 0 0 0 0 1 0 1
  29. Envelope/tremolo/vibrato data:
  30.   56 178 168  69  63  63 246 246 246   8   8   8   0   0   0  80 200   8
  31. Flags: 16-bit looped forward melodic 
  32.  
  33.  
  34.  
  35. File: MIDI\CLARINET.PAT 
  36. This file contains  7  sample(s).
  37.  
  38. Sample # 1 
  39. Sample length: 5172         Loop start:  4368           Loop end: 5050 
  40. Sample rate: 29761 Hz
  41. Low freq: 27.499 (A0)    High freq: 146.832 (D3)    Base freq: 87.306 (F2)
  42. Detune: 0     Octave: 2     Balance: 7    Mode: 0 1 0 0 0 0 0 0
  43. Envelope/tremolo/vibrato data:
  44.   58   8 193  66  63  63 246 246 243   8   8   8  60 255  33  60 200   8
  45. Flags: 16-bit looped forward melodic 
  46.  
  47.  
  48. Sample # 2 
  49. Sample length: 4202         Loop start:  3720           Loop end: 4124 
  50. Sample rate: 29761 Hz
  51. Low freq: 146.832 (D3)    High freq: 207.652 (G#3)    Base freq: 146.832 (D3)
  52. Detune: 0     Octave: 2     Balance: 7    Mode: 1 1 1 0 0 0 0 0
  53. Envelope/tremolo/vibrato data:
  54.   58   8 193  66  63  63 246 246 243   8   8   8  60 255  33  60 200   6
  55. Flags: 16-bit looped forward melodic 
  56.  
  57.  
  58. Sample # 3 
  59. Sample length: 1480         Loop start:  1212           Loop end: 1452 
  60. Sample rate: 29761 Hz
  61. Low freq: 207.652 (G#3)    High freq: 293.664 (D4)    Base freq: 246.941 (B3)
  62. Detune: 0     Octave: 2     Balance: 7    Mode: 0 1 1 0 0 0 0 0
  63. Envelope/tremolo/vibrato data:
  64.   58   8 193  67  63  63 246 246 243   8   8   8  60 255  33  60 200   6
  65. Flags: 16-bit looped forward melodic 
  66.  
  67.  
  68. Sample # 4 
  69. Sample length: 2234         Loop start:  2046           Loop end: 2226 
  70. Sample rate: 29761 Hz
  71. Low freq: 293.664 (D4)    High freq: 415.304 (G#4)    Base freq: 331.828 (?E4)
  72. Detune: 0     Octave: 2     Balance: 7    Mode: 0 1 1 0 0 0 0 0
  73. Envelope/tremolo/vibrato data:
  74.   58   8 193  67  63  63 246 246 243   8   8   8  60 255  33  60 200   5
  75. Flags: 16-bit looped forward melodic 
  76.  
  77.  
  78. Sample # 5 
  79. Sample length: 1804         Loop start:  1676           Loop end: 1796 
  80. Sample rate: 29761 Hz
  81. Low freq: 415.304 (G#4)    High freq: 587.329 (D5)    Base freq: 493.883 (B4)
  82. Detune: 0     Octave: 2     Balance: 7    Mode: 0 1 0 1 0 0 0 0
  83. Envelope/tremolo/vibrato data:
  84.   58   8 193  67  63  63 246 246 243   8   8   8  60 255  33  60 200   5
  85. Flags: 16-bit looped forward melodic 
  86.  
  87.  
  88. Sample # 6 
  89. Sample length: 2216         Loop start:  2124           Loop end: 2208 
  90. Sample rate: 29761 Hz
  91. Low freq: 587.329 (D5)    High freq: 830.609 (G#5)    Base freq: 699.82 (?F5)
  92. Detune: 0     Octave: 2     Balance: 7    Mode: 1 0 1 0 0 0 0 0
  93. Envelope/tremolo/vibrato data:
  94.   58   8 193  68  63  63 246 246 243   8   8   8  60 255  33  60 200   5
  95. Flags: 16-bit looped forward melodic 
  96.  
  97.  
  98. Sample # 7 
  99. Sample length: 1142         Loop start:  1068           Loop end: 1132 
  100. Sample rate: 29761 Hz
  101. Low freq: 830.609 (G#5)    High freq: 4186.073 (C8)    Base freq: 925.044 (?A#5)
  102. Detune: 0     Octave: 2     Balance: 7    Mode: 0 0 1 1 0 0 0 0
  103. Envelope/tremolo/vibrato data:
  104.   58   8 193  68  63  63 246 246 243   8   8   8  60 255  33  60 200   5
  105. Flags: 16-bit looped forward melodic 
  106.  
  107.  
  108. This document shows you how to use PatInfo and how to interpret its 
  109. output.  An accompanying document, PATCH.DOC shows the layout of the
  110. patch files in more detail, and shows the location of the data that 
  111. PatInfo prints out.
  112.  
  113.  
  114.  
  115. How to Run the PatInfo
  116. ----------------------
  117. PatInfo is a DOS program that you can run from the command line.  The
  118. syntax is:
  119.  
  120.    PATINFO  patchnam.pat
  121.  
  122. There are no switches, you must inlcude the file extension, and you can
  123. only view one file at a time.
  124.  
  125.  
  126.  
  127.  
  128. The Output of PatInfo
  129. ---------------------
  130. You've already seen an example of the output above.  Let's take a closer
  131. look at the various fields and see what they mean.
  132.  
  133. >>File: MIDI\TRUMPET.PAT 
  134. >>This file contains  2  sample(s).
  135.  
  136. The file name is simply the filespec you entered on the command line
  137. when you ran PatInfo.  The first bit of information PatInfo looks for
  138. is how many samples are in the file.  Patches can contain more than
  139. one sample, usually real instruments are sampled at various points in
  140. their range to make the patch sound more realistic.  In this case, the
  141. trumpet patch has 2 samples in it.
  142.  
  143. >>Sample # 1 
  144. >>Sample length: 6908         Loop start:  6660           Loop end: 6890 
  145.  
  146. Each sample has some information associated with it in the patch file.  
  147. PatInfo will print out the data stored for every patch in the file.  In
  148. this case, we are seeing the data for the first sample stored in the file.
  149. The sample length is in bytes, and the loop start and end are byte offsets
  150. into the sample.  Why isn't the loop end at the end of the sample?  I don't
  151. know, PatInfo just reports what it sees.
  152.  
  153. >>Sample rate: 44642 Hz
  154. >>Low freq: 27.499 (A0)    High freq: 466.163 (A#4)    Base freq: 390.464 (?G4)
  155.  
  156. The samples used on the Ultrasound will be played back at many different
  157. rates to produce different notes, or pitches.  Precise information is
  158. needed to produce correct pitches.  It seems that if you play back the
  159. sample at the indicated sample rate, the base frequency should be heard.
  160. The low frequency and high frequencies are the limits within which this
  161. sample can be used.  PatInfo works out the actual note names for the
  162. frequencies.  This can be useful for those that can read musical notation.
  163. If a question mark appears before the note name (as it does above) the note
  164. name is only approximate;  the frequency that is reported lies between 
  165. the notes of the equal tempered scale.  It seems that many of the patches
  166. on the 2.01 installation disks have base frequencies that are not precise
  167. note frequencies.
  168.  
  169. >>Detune: 0     Octave: 2     Balance: 7    Mode: 0 0 0 0 1 1 0 1
  170.  
  171. Detune is a value that is used to correct samples that were slightly out of
  172. tune.  It doesn't seem to be used anymore in the 2.01 patches.
  173.  
  174. The value of the octave setting determines what is the default octave
  175. the sample will play at.  A setting of 2 means that the note will play 
  176. at the same octave it was sampled at.  That means that if the card is to
  177. play a C5, a C5 will sound.  A setting of 1 means that the sample will 
  178. play an octave down, that is if a C5 is to be played, a C4 will sound.  
  179. A setting of 3 means that the sample will play an octave up; that is if a
  180. C5 is to be played, a C6 will sound.
  181.  
  182. The balance is the default value for the stereo panning for this sample.
  183. A value of 7 means that the sound is centered in the stereo field.  A value
  184. of 0 means full left and a value of 15 is full right.
  185.  
  186. The value of mode is the settings of the bits in what I call the mode
  187. byte.  I can't tell what these bits do; I included their settings to
  188. compare them with other patches.
  189.  
  190. >>Envelope/tremolo/vibrato data:
  191. >>  56 178 168  69  63  63 246 246 246   8   8   8   0   0   0  80 200   8
  192.  
  193. 12 bytes seem to be allocated to describing the amplitude envelope.  I'm
  194. not exactly sure of their meaning, but I have deduced the following
  195. guidelines:
  196. The higher the value of the first byte, the slower the attack of the note
  197. is.
  198. The higher the value of the second byte, the longer the attack of the note
  199. takes.
  200. The fourth byte seems to be related to the release level.
  201. The lower the value of the seventh byte, the slower the attack is.
  202. The lower the value of the eighth byte, the longer the delay is between
  203. the note on event and the beginning of the attack.
  204. The ninth byte is the level of the release.
  205. The tenth byte is the length of the release.  A small value (like above)
  206. means that the note ends as soon as the key off event is recieved.
  207.  
  208. The next three bytes describe the tremolo, or a slight variation in pitch
  209. over time.  The first byte is the tremolo sweep, the second is the rate,
  210. and the third is the depth of the tremolo.
  211.  
  212. The last three bytes describe the vibrato, or a slight variation in the
  213. amplitude of the sustained note.  The first byte is the vibrato sweep,
  214. the second is the rate, and third byte is the depth.
  215.  
  216. >>Flags: 16-bit looped forward melodic 
  217.  
  218. One byte in the sample information seems to be flags.  One flag tells if
  219. the sample is 16-bit or 8-bit.  Another tells if the sample is looped
  220. if the note is sustained, or if the sample plays once straight through with
  221. no loop.  Samples can also be played either forward or backward.  The
  222. sample can also be of either a melodic instrument, or a percussive
  223. effect or instrument.  
  224.  
  225.  
  226.  
  227.  
  228. That's it!  If you want more information about the patch file, see the
  229. file PATCH.DOC.  I don't own the Ultrasound SDK.  Most of the information
  230. here I got from experimentation, observation, and deduction.  I don't
  231. guarantee any of it, and it all may change at any time.  I also might
  232. be totally wrong about the use of the some of the data in the patch file.
  233. I won't take responsibility if you destroy data or hardware by mis-using
  234. the information in these documents.
  235.  
  236.  
  237.  
  238. If you have any comments, questions, or critizism, write to me at:
  239.  
  240.       aa344@yfn.ysu.edu
  241.  
  242.                                         -Joseph Maruschek
  243.  
  244.  
  245.